word="ggg"
def detectCapitalUse(word):
    if word[0]>="A" and word[0]<="Z":
        is_first=True
    else:
        is_first=False
    print(is_first,"----------is_first-----------")
    #第二个元素
    if len(word)<=1:
        return True
    else:
        if is_first and word[1]>="A" and word[1]<="Z":
            is_second=True
        elif not is_first and word[1]>="A" and word[1]<="Z":
            return False
        else:
            is_second=False
        print(is_second,"---------------is_second-----------")
    for i in range(2,len(word)):
        if not is_second and (word[i]>="A" and word[i]<="Z"):
            return False
        if is_second and (word[i]<"A" or word[i]>"Z"):
            return False
    return True
print(detectCapitalUse(word))



